from typing import List

def draw_x(n) -> List[List[str]]:
    if n == 1:
        return [['X']]

    pattern_n_1 = draw_x(n-1)
    size_n_1 = len(pattern_n_1)

    size_n = size_n_1 * 3
    arr = [[' ' for _ in range(size_n)] for _ in range(size_n)]
    for big_row in range(3):
        for big_col in range(3):
            if big_row == big_col or big_row + big_col == 2:
                for row in range(size_n_1):
                    for col in range(size_n_1):
                        arr[size_n_1 * big_row + row][size_n_1 * big_col + col] = pattern_n_1[row][col]
    return arr


def print_draw_n(n):
    arr = draw_x(n)
    lines = [''.join(row).rstrip() for row in arr]
    for line in lines:
        print(line)


if __name__ == '__main__':
    n = int(input())
    print_draw_n(n)